<%@ page language="java"  pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/struts-tags.tld" prefix="s"%>
<!DOCTYPE html>
<html lang="zh">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title><s:property value="scrName"/>-沈阳外卖网</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="在<s:property value="scrName"/>附近叫外卖，查看<s:property value="scrName"/>附近的餐厅、美食信息" />
<!-- Bootstrap -->
<link href="publicui/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen" />
<!--[if lt IE 9]>
  <script src="public/js/html5shiv.js"></script>
<![endif]-->
<!-- application  -->
<link href="css/head.css" rel="stylesheet" />
<link href="css/foot.css" rel="stylesheet" />
<link href="css/last.css" rel="stylesheet" />
<script type="text/javascript">
var typeId=new Array(""
        <s:if test="typeList!=null">
  		<s:iterator id="tl" value="%{typeList}">
                ,"<s:property value="#tl.id"/>"
        </s:iterator>
  		</s:if>
);
function showAll(){
	for(var i=1;i<typeId.length;i++){
		document.getElementById('food-category-'+typeId[i]).style.display="";
    }
}
function showType(id){
	for(var i=1;i<typeId.length;i++){
		if(typeId[i] == id){
			document.getElementById('food-category-'+typeId[i]).style.display="";
		}
		else{
			document.getElementById('food-category-'+typeId[i]).style.display="none";
		}
    }
}
</script>
</head>

<body >
<div class="bodybg" >
<!-----nav-->
<s:action name="top" executeResult="true">
<s:param name="resName"><s:property value="restaurant.resName"/></s:param>
</s:action>
<!---/nav   --> 

<!---/body   -->
<div class="content" >
  <!--  content    start   -->
  <div class="row-fluid">
      <div class="span12 right-fold bordered-box">
        <div class="important-info alert warning"> <s:property value="restaurant.notice"/> </div>
        <div class="row-fluid">
          <div class="span9 master-side restaurant-content">
            <ul class="nav nav-tabs restaurant-tab">
              <li class="active"><a rel="nofollow" href="#">菜单</a></li>
               <li ><a rel="nofollow" href="#">促销</a></li> 
             <!-- <li ><a rel="nofollow" href="#">评价</a></li>  -->
            </ul>
            <div class="restaurant-tab-content">
              <div class="menu-category-filter">
                <ul>
                  <li rel="all" class="active" onclick="showAll();">所有美食</li>
                  <s:if test="typeList!=null">
                  <s:iterator id="tl" value="%{typeList}">
                  	<li rel="<s:property value="#tl.id"/>" onclick="showType(<s:property value="#tl.id"/>);"><s:property value="#tl.typeName"/></li>
                  </s:iterator>
                  </s:if>
                </ul>
              </div>
              <div class="menu">
              <!--  
                <div class="sorter-wrapper">
                    <a rel="nofollow" class="sorter  price" href="#" rel="nofollow" > 
                    <span class="bg" > 
                        <span class="text">价格</span> 
                        <span class="asc"></span>
                    </span> 
                    <span class="pad"></span> 
                    </a>
                    <a rel="nofollow" class="sorter  pop--" href="#" rel="nofollow" > 
                    <span	class="bg"> 
                        <span class="text">人气</span> 
                        <span class="desc"></span>
                    </span> 
                    <span class="pad"></span> 
                    </a>
                    <a rel="nofollow" class="sorter  rating" href="#" rel="nofollow" >
                        <span class="bg"> 
                            <span class="text">评价</span> 
                            <span class="desc"></span> 
                        </span> 
                        <span class="pad"></span> 
                    </a>
                </div>
                 -->
                 
                 
           		<!--  单个菜单分类  start     -->
           		<s:if test="typeList!=null">
                <s:iterator id="tl" value="%{typeList}">
                <div class="food-category" id="food-category-<s:property value="#tl.id"/>"> <a name="category-<s:property value="#tl.id"/>"></a>
                  <ul class="food-list ">
                    <h3 class="food-category-title"><s:property value="#tl.typeName"/></h3>
                    <s:if test="#tl.resMenuList!=null">
                    <s:iterator id="rml" value="%{#tl.resMenuList}">
                    <s:if test="#rml.isImg==1">
                    <!--    有图单条菜价     -->
                    <div class="image-food-item" id="food-<s:property value="#rml.id"/>"> 
  					<div class="line-one"> <img src="http://fuss10.elemecdn.com/4/fa/e4696add602125b0347014719535ejpeg.jpeg" /> </div>
                      <div class="line-two">
                        <h4 class="name"><s:property value="#rml.menuName"/></h4>
                        <span class="price"><s:property value="#rml.priceShow"/>元</span> </div>
                      <div class="line-three rating-popularity"> <span class="rating-star r<s:property value="#rml.score"/>"></span> <span class="popularity">共售<s:property value="#rml.buyNum"/>份</span> </div>
                      <div class="line-three extra-action-wrapper"> </div>
                      <div class="line-four"> <!--<a href="/food/111371551516152" target="_blank" class="rating-num hover-food-link" rel="<s:property value="#rml.id"/>">1点评</a> -->
                      <span class="action"> <span class="food-action-wrapper"> 
                      <s:if test="restaurant.isBusiness==1">
                      <span class="food-action add" resId="<s:property value="restaurant.id"/>" menuName="<s:property value="#rml.menuName"/>" copies="1" price="<s:property value="#rml.price"/>" resName="<s:property value="restaurant.resName"/>"></span> 
                      </s:if>
                      <s:if test="restaurant.isBusiness==0"><span class="food-action gray" fid="1891332">休息中</span></s:if>
                      </span> </span> </div>
						</div>
                    <!--   /有图单条菜价         -->
                    </s:if>
                    </s:iterator>
                    <s:iterator id="rml" value="%{#tl.resMenuList}">
                    <s:if test="#rml.isImg==0">
                    <!--  单条菜价   start  -->
                    <li class="food-item" id="food-<s:property value="#rml.id"/>">
                      <div class="line-one">
                        <div class="green_right"></div>
                        <div class="name">
                          <h4><s:property value="#rml.menuName"/></h4>
                        </div>
                        <div class="price"><s:property value="#rml.priceShow"/>元</div>
                        <div class="action"> 
                        <span class="food-action-wrapper with-add-to"> 
                        <s:if test="restaurant.isBusiness==1">
                        	<span class="food-action add" resId="<s:property value="restaurant.id"/>" menuName="<s:property value="#rml.menuName"/>" copies="1" price="<s:property value="#rml.price"/>" resName="<s:property value="restaurant.resName"/>"></span> 
                        </s:if>
                        <s:if test="restaurant.isBusiness==0">
                        	<span class="food-action gray" fid="<s:property value="#rml.id"/>">休息中</span>
                        </s:if>
                        </span>
                        </div>
                        <div class="month-sold">共售<s:property value="#rml.buyNum"/>份</div>
                        <div class="rating"> <span class="rating-star r<s:property value="#rml.score"/>"></span> </div>
                      </div>
                      <div class="line-two"> <a class="desc" rel="tooltip" title=""></a> 
                      <!--<a href="/food/4000633158" target="_blank" class="extra-action-wrapper hover-food-link" rel="<s:property value="#rml.id"/>">5点评</a>-->
                       </div>
                    </li>
                    <!--  单条菜价   end  -->
                    </s:if>
                    </s:iterator>
                    </s:if>
                  </ul>
                </div>
                </s:iterator>
                </s:if>
                
                
              </div>
            </div>
          </div>
          <div class="span3 slave-side">
            <div class="restaurant-panel-wrapper restaurant-panel"> <span class="favor-icon"></span>
              <div class="restaurant-block">
                <div class="line-one">
                  <div class="logo-wrapper">
                    <div class="logo"> <img class="restaurant-logo" alt="" src="http://fuss10.elemecdn.com/a/b8/24ff7fcd943b22571516631cf1407jpeg.jpeg"> </div>
                    <!--<div class="deliver-time-wrapper"> 10 分钟 </div>-->
                  </div>
                  <div class="info">
                    <div class="name" title="<s:property value="restaurant.resName"/>"><s:property value="restaurant.resName"/></div>
                    <div class="flavors three-line"> <s:property value="restaurant.resTaste"/> </div>
                    <div class="ratings three-line">
                      <div class="r<s:property value="restaurant.score"/> rating-star" title="餐厅评价：<s:property value="restaurant.score"/>分"> <span class="ratings"></span> </div>
                      <!-- <span class="rating-number">62点评 (30天内)</span> -->
                      </div>
                  </div>
                </div>
              </div>
              <div class="restaurant-more-info">
                <div class="divider "></div>
                <p class="ann"><strong>公告:</strong>&nbsp;<s:property value="restaurant.notice"/></p>
                <p class="ann"><strong>促销:</strong>&nbsp;<s:property value="restaurant.salesPromotion"/></p>
                <p class="ann"><strong>特殊说明:</strong>&nbsp;<s:property value="restaurant.specialMemo"/></p>
                <p class="restaurant-deliver-desc"><strong>起送价:</strong>&nbsp;<s:property value="restaurant.deliveryPrice"/>元</p>
                <p><strong>地址:</strong>&nbsp;<s:property value="restaurant.address"/></p>
                <p><strong>营业时间:</strong>&nbsp;
                <s:if test="timeList!=null">
                <s:iterator id="timel" value="%{timeList}">
                <s:property value="#timel.startHour"/>:<s:property value="#timel.startMinute"/>&nbsp;-&nbsp;<s:property value="#timel.endHour"/>:<s:property value="#timel.endMinute"/>&nbsp;&nbsp;
                </s:iterator>
                </s:if>
                </p>
                <p><strong>简介:</strong>&nbsp;<s:property value="restaurant.summary"/></p>
                <s:if test="#session.user_session!=null">
                <p class="btn-wrapper" id="collect_p">
                  <s:if test="restaurant.isCollect==1"><button class="btn small yellow  favor-restaurant" onclick="collect(0,<s:property value="restaurant.id"/>);"><span>取消收藏</span></button></s:if>
                  <s:if test="restaurant.isCollect==0"><button class="btn small yellow  favor-restaurant" onclick="collect(1,<s:property value="restaurant.id"/>);"><span>添加收藏</span></button></s:if>
                </p>
                </s:if>
              </div>
            </div>
          </div>
        </div>
      </div>
    
    </div>
   <div class="food-category-selector" style="margin-left: -25px;">
      <div class="trigger" style="">菜单分类</div>
      <div class="list" style="display: none;">
        <div class="head"> </div>
        <div class="title"> 菜单分类 </div>
        <s:if test="typeList!=null">
        <ul>
         <s:iterator id="tl" value="%{typeList}">
          <li rel="<s:property value="#tl.id"/>"> <a href="#category-<s:property value="#tl.id"/>"><s:property value="#tl.typeName"/></a> </li>
         </s:iterator>
        </ul>
        </s:if>
        <div class="foot"> </div>
      </div>
    </div>
<script type="text/javascript">
    var tab_page = "menu";
    var restaurant_id = '<s:property value="restaurant.id"/>';
	//_source 的信息暂时没有用到
	/**
    var foods_source = eval([{"id":2000808,"search_text":"\u7ea2\u67a3\u82b1\u751f\u7ca5hongzaohuashengzhou hzhsz","category_id":150982},{"id":2000809,"search_text":"\u7ea2\u8c46\u9ed1\u7c73\u7ca5hongdouheimizhou hdhmz","category_id":150982},{"id":2000803,"search_text":"\u6b63\u5408\u5473\u9762\u76ae+\u706b\u70e7\u6216\u5364\u86cbzhengheweimianpihuoshaohuoludan zhwmp+hshld","category_id":150982},{"id":2000806,"search_text":"\u6b63\u5408\u5473\u9762\u76ae+\u996e\u6599zhengheweimianpiyinliao zhwmp+yl","category_id":150982},{"id":2000805,"search_text":"\u6b63\u5408\u5473\u9762\u76ae+\u5364\u86cb+\u725b\u8089zhengheweimianpiludanniurou zhwmp+ld+nr","category_id":150982},{"id":2000804,"search_text":"\u6b63\u5408\u5473\u9762\u76ae+\u706b\u70e7+\u725b\u8089zhengheweimianpihuoshaoniurou zhwmp+hs+nr","category_id":150982},{"id":2000807,"search_text":"\u79d8\u5236\u9aa8\u6c64\u7ea2\u70e7\u725b\u8089\u9762mizhigutanghongshaoniuroumian mzgthsnrm","category_id":150982}]);
	**/
    var restaurant_has_activity_half_price = false;
</script>
<!--   content    end    -->
<s:action name="foot" executeResult="true"></s:action>
<!---/body   --> 

</div>



<script src="publicui/js/jquery-1.8.3.js"></script> 
<script src="publicui/jquery-ui/js/jquery-ui-1.9.2.custom.js"></script> 
<script src="publicui/bootstrap/js/bootstrap.min.js"></script> 
<script src="js/head.js"></script> 
<script src="js/last.js"></script> 
<script type="text/javascript">
function collect(s,id){
	if(s==0){
		$.ajax({
			url:"collect.action?action=removeAjax&objId="+id+"&objType=0",
			dataType:"html", 
			success: function(html){
				if(html==0){
					$('#collect_p').html('<button class="btn small yellow  favor-restaurant" onclick="collect(1,'+id+');"><span>添加收藏</span></button>');
				}
			}
		});
	}else{
		$.ajax({
			url:"collect.action?action=saveRes&objType=0&objId="+id,
			dataType:"html", 
			success: function(html){
				if(html==0){
					$('#collect_p').html('<button class="btn small yellow  favor-restaurant" onclick="collect(0,'+id+');"><span>取消收藏</span></button>');
				}else if(html==1){
					alert("您已经收藏了此店铺");
				}else{
					alert("操作失败，请稍后尝试");
				}
			}
		});
	}
}
</script>
<s:if test="error!=null&&error!=''">
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">提示</h3>
  </div>
  <div class="modal-body">
    <p><s:fielderror><s:param>error</s:param></s:fielderror></p>
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
   <!-- <button class="btn btn-primary">确定 </button>   -->
  </div>
</div>
<script type="text/javascript"  >
$('#myModal').modal();
</script>
</s:if>
</body> 
</html>